/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DTO;

import BLL.BLLOrder;
import BLL.BLLProduct;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author Pham
 */
public class DTOOrderDetail {
    DTOProduct dtoPro;
    DTOOrder dtoOrder;
    int quantity;
    
    //accessor
    public DTOProduct getDtoPro() {
        return dtoPro;
    }

    public void setDtoPro(DTOProduct dtoPro) {
        this.dtoPro = dtoPro;
    }

    public DTOOrder getDtoOrder() {
        return dtoOrder;
    }

    public void setDtoOrder(DTOOrder dtoOrder) {
        this.dtoOrder = dtoOrder;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }
    
    //constructor
    public DTOOrderDetail()
    {}
    
    public DTOOrderDetail(ResultSet rs) throws SQLException
    {
        this.dtoPro = (new BLLProduct()).getProductbyID(rs.getInt("product_id"));
        this.dtoOrder = (new BLLOrder()).getOrderbyId(rs.getString("order_id"));
        this.quantity = rs.getInt("quantity");
    }
}
